﻿<%-- 
    Copyright (C) Binod Nepal, Planet Earth Solutions Pvt. Ltd., Kathmandu.
	Released under the terms of the GNU General Public License, GPL, 
	as published by the Free Software Foundation, either version 3 
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
--%>

<%@ Page Title="" Language="C#" MasterPageFile="~/Classifieds/Main.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="MixNP.Web.Classifieds.Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="StyleSheetContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptsContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
    <h1>
        <asp:Literal ID="SearchLiteral" runat="server" Text="Search" />
    </h1>
    <hr class="hr" />
    <asp:Literal ID="Literal404" runat="server" />
    <div class="vpad8">
        <div class="vpad8 hpad2">

            <span id="search2">
                <asp:TextBox ID="SearchTextBox" runat="server" CssClass="textbox wide" placeholder="Enter Search Terms ..." />
            </span>

        </div>
        <div id="advanced-search" style="display: none;" class="vpad8 hpad2">
            Category :
            <br />
            <asp:DropDownList ID="CategoryDropDownList" runat="server" DataTextField="CategoryName"
                DataValueField="CategoryId" DataSourceID="SqlDataSource1" CssClass="dropdownlist wide">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PESConnectionString %>"
                SelectCommand="SELECT 0 AS CategoryId, 'All Categories' AS CategoryName, 0 AS ParentCategoryId  UNION ALL
                               SELECT CategoryId, CategoryName + '&nbsp;&nbsp;&nbsp;&nbsp;&lt;--' + dbo.GetParentCategoryName(CategoryId) + '' AS CategoryName, ParentCategoryId
                                        FROM dbo.Categories
                                        WHERE ParentCategoryId IS NOT NULL
                                        ORDER BY ParentCategoryId;"></asp:SqlDataSource>
            <br />
            City:
            <br />
            <pes:CityDropDownList ID="CityDropDownList" runat="server" CssClass="dropdownlist wide"
                TabIndex="20" Anywhere="true" />
            <br />
            Price Between:
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <asp:TextBox ID="PriceStartTextBox" runat="server" CssClass="textbox" TextMode="Number" />
                    </td>
                    <td>
                        and
                    </td>
                    <td>
                        <asp:TextBox ID="PriceEndTextBox" runat="server" CssClass="textbox" TextMode="Number" />
                    </td>
                </tr>
            </table>
            Sort By:<br />
            <asp:DropDownList ID="SortByDropDownList" runat="server" CssClass="dropdownlist">
                <asp:ListItem Text="Popularity" Value="0" />
                <asp:ListItem Text="Least Price" Value="1" />
                <asp:ListItem Text="Highest Price" Value="2" />
                <asp:ListItem Text="Date Added" Value="3" />
            </asp:DropDownList>
        </div>
        <div class="vpad8">
            <asp:Button ID="SearchButton" runat="server" Text="Search" OnClick="SearchButton_Click" />
        </div>
        <a href="#" onclick="$('#advanced-search').toggle(1000);">
            Advanced Search
        </a>
    </div>
    <webdiyer:AspNetPager ID="TopPager" runat="server" CssClass="pager" UrlPaging="True"
        PagingButtonType="Text" NumericButtonType="Text" NavigationButtonType="Text"
        ShowNavigationToolTip="true" ShowPageIndexBox="Never" ShowPageIndex="true" AlwaysShowFirstLastPageNumber="true"
        AlwaysShow="false" UrlPageIndexName="page">
    </webdiyer:AspNetPager>
    <asp:Repeater ID="CardRepeater" runat="server">
        <ItemTemplate>
            <pes:HorizontalItemCard ID="HorizontalItemCard1" runat="server" ItemId='<%# Bind("ItemId") %>' />
        </ItemTemplate>
    </asp:Repeater>
    <asp:Literal ID="NothingLiteral" runat="server" />
    <webdiyer:AspNetPager ID="BottomPager" runat="server" CssClass="pager" UrlPaging="True"
        PagingButtonType="Text" NumericButtonType="Text" NavigationButtonType="Text"
        ShowNavigationToolTip="true" ShowPageIndexBox="Never" ShowPageIndex="true" AlwaysShowFirstLastPageNumber="true"
        AlwaysShow="false" UrlPageIndexName="page">
    </webdiyer:AspNetPager>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptsContentPlaceHolderBottom"
    runat="server">
</asp:Content>
